package br.com.ifsp.salto.matriculadp.dados.rowmapper;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.jdbc.core.RowMapper;

import br.com.ifsp.salto.matriculadp.negocio.to.DisciplinaTO;

/**
 * Mapeia uma {@link DisciplinaTO} de um {@code ResultSet}.
 */
public class DisciplinaTORowMapper implements RowMapper<DisciplinaTO> {

	public DisciplinaTO mapRow(ResultSet rs, int line) throws SQLException {
		return new DisciplinaTO(rs.getLong("d.codigo"), rs.getString("d.nome"),
				rs.getString("d.sigla"), rs.getInt("s.semestre"), rs.getInt("d.carga_horaria"));
	}
}
